These examples have been formatted for easier reading. Newlines are not required in the actual JSON data.
Single “message” supplied via “values” JSON object:
{ "target": "UID998783",
"code": "mp10",
"time": "2014-07-24T18:47:43Z",
"location": {"latitude":37.795227, "longitude":-122.398828},
"values": {"temp": 98.6, "humidity": 68.2}
}
Multiple “messages” supplied via “values” JSON array of objects. Each of the array elements supplied via the “values” JSON array will generate one message on the server all of which will have the same “time” and “location” values.
{ "target": "UID998783",
"code": "mp10",
"time": "2014-07-24T18:47:43Z",
"location": {"latitude":37.795227, "longitude":-122.398828},
"values": [{"temp": 98.6, "humidity": 68.2}, {"temp": 101.4, "humidity":
70.4}]
}
target
code
time
Format:
Example:
location
A JSON object or an array of objects named values will contain one or more JSON values that are to be processed as the message values that correspond to the message identified via the code field value.
values
values (array)
Periodic Updates Sending Sensor data (e.g., Temperature and Humidity) on a periodic interval. The block below will be posted via UDP/TCP to Fusion Connect by device on a periodic basis.
{ "target": "UID998783", "code": "mp10", "time": "2014-07-24T18:47:43Z", "location": {"latitude":37.795227, "longitude":-122.398828}, "values": {"temp": 98.6, "humidity": 68.2} }
Historical Data Snapshot Instead of posting data on a periodic basis – this method allows the user to aggregate data locally on the device and then send the readings in one packet to minimize OTA and data costs. E.g. Collect temperature and humidity readings from the last 60 minutes sampled every 15 minutes and send to Fusion Connect in one packet.
{ "target": "UID998783", "code": "mp10", "time": "2014-07-24T18:47:43Z", "location": {"latitude":37.795227, "longitude":-122.398828}, "values": [ {"temp": 98.9, "humidity": 68.8, "rtime": "2014-07-24T18:00:00Z"}, {"temp": 98.5, "humidity": 68.3, "rtime": "2014-07-24T18:15:00Z"}, {"temp": 97.9, "humidity": 67.8, "rtime": "2014-07-24T18:30:00Z"}, {"temp": 98.6, "humidity": 68.2, "rtime": "2014-07-24T18:45:00Z"}] }
Alerts/Alarms Sends alert information to Fusion Connect. With smarter devices that have processing capabilities – the device can notify the server when events of interest occur. For example, if a the temperature is greater than 50 degrees, (e.g., Temp > 50), you can send a temperature alarm along with current temperature and humidity information. The information is sent to the server only when the alarm condition is triggered on the device.
{ "target": "UID998783", "code": "mp10", "time": "2014-07-24T18:47:43Z", "location": {"latitude":37.795227, "longitude":-122.398828}, "values": { "temp_alarm": "High", "temp": 98.6, "humidity": 68.2} }